//
//  DynamicColumnFieldCore+MoveViewController.m
//  
//
//  Created by wjxfhxy on 15/12/30.
//
//

#import "DynamicColumnFieldCore+MoveViewController.h"

#import "DynamicColumnFieldCore+Internal.h"

@implementation DynamicColumnFieldCore (MoveViewController)

- (void)recvPopViewControllerSwitchParam:(XUIViewControllerSwitchParam *)switchParam
{
    if(switchParam.param[MultiSelectViewControllerSelectContentFormatParamKey] != nil)
    {
        MultiSelectGroupTableViewCell *cell = (MultiSelectGroupTableViewCell*)_selectedCell;
        cell.content = switchParam.param[MultiSelectViewControllerSelectContentFormatParamKey];
        cell.selectitems = switchParam.param[MultiSelectViewControllerSelectParamKey];
        ((MultiSelectGroupTableViewCell*)_selectedCell).text = cell.content;
    }
    else if(switchParam.param[ChoiceCurrentPositionViewControllerChoicPositionParamKey] != nil)
    {
        NSString *selectAddress = switchParam.param[ChoiceCurrentPositionViewControllerChoicPositionParamKey];
        NSArray *ar = [selectAddress componentsSeparatedByString:@";"];
        ((PositionGroupTableViewCell*)_selectedCell).selectAddress = selectAddress;
        ((PositionGroupTableViewCell*)_selectedCell).text = ar[2];
    }
    else if(switchParam.param[ChoiceVoiceViewControllerChoiceVoiceParamKey] != nil)
    {
        NSString *voicePath = switchParam.param[ChoiceVoiceViewControllerChoiceVoiceParamKey];
        
        NSLog(@"%@",voicePath);
        
        UIImage *img = [UIImage imageNamed:@"img_voice_default"];
        [(MixedPanelGroupTableViewCell*)_selectedCell addImage:img withTag:voicePath];
    }
    else if(switchParam.param[ChoiceRecordViewControllerChoiceRecordParamKey] != nil)
    {
        KZVideoModel *model = switchParam.param[ChoiceRecordViewControllerChoiceRecordParamKey];
        
        NSLog(@"%@",model.videoAbsolutePath);
        
        UIImage *img = [UIImage imageNamed:@"img_video_default"];
        [(MixedPanelGroupTableViewCell*)_selectedCell addImage:img withTag:model.videoAbsolutePath];
    }
    
    _selectedCell = nil;
}

@end
